# Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
# Contributor: Tércio Martins <echo dGVyY2lvd2VuZGVsQGdtYWlsLmNvbQo= | base64 -d>
# Contributor: Alexey Pavlov <alexpux@gmail.com>

pkgname=pystring
pkgver=1.1.4
pkgrel=1
arch=('loong64' 'x86_64')
pkgdesc="C++ functions matching the interface and behavior of python string methods with std::string"
url="https://github.com/imageworks/pystring"
license=('BSD')
depends=('gcc-libs')
source=("$pkgname-$pkgver.tar.gz::https://github.com/imageworks/pystring/archive/v$pkgver.tar.gz"
        "$pkgname-fix-makefile.patch::https://github.com/imageworks/pystring/pull/42.patch")
sha512sums=('9c0460fea67885492f9b0d29a9ba312d960fd5e43577cdcfd47faf04397ff4b7e456ed68f1948b923d2f63f9922d576b93e4ca1a27376bcb6d29c683828acb01'
            '2e8dea3c0e3a90fbb1ae4891e2aa59f10996825b10daf90476fec8c205e36f575ef9bec897ef5126fab957ca081f7b9cf1cd04e4ebdb3636496fb38b978f560c')

prepare() {
  cd $pkgname-$pkgver
  patch -p1 -i "$srcdir/$pkgname-fix-makefile.patch"
}

build() {
  cd $pkgname-$pkgver
  make
}

package() {
  cd $pkgname-$pkgver
  DESTDIR="$pkgdir" make install

  install -Dm644 "$srcdir/$pkgname-$pkgver/LICENSE" "$pkgdir/usr/share/licenses/$pkgname"/LICENSE
}
